Skip to content

[core] Avoid repeated sorted-index source lookups - #9187

Merged
JingsongLi merged 1 commit into
apache:masterfrom
QuakeWang:pk-source-lookup
Aug 13, 2026
Merged

[core] Avoid repeated sorted-index source lookups#9187
JingsongLi merged 1 commit into
apache:masterfrom
QuakeWang:pk-source-lookup

Conversation

@QuakeWang

Copy link
Copy Markdown
Member

Purpose

Primary-key sorted-index scans previously located each data file by linearly walking its source group. Repeating the lookup for every file made source localization quadratic in the number of source files.

Build a file-name-to-source-location map alongside the existing offsets so file-local readers use constant-time lookups while preserving row-count validation.

Tests

  • mvn -pl paimon-core -DwildcardSuites=none -Dtest=PrimaryKeySortedIndexScanTest test

Primary-key sorted-index scans linearly searched each source group to locate every data file, making source localization quadratic in the number of files.

Build a file-name lookup alongside source offsets and preserve row-count validation when creating file-local readers.

Signed-off-by: QuakeWang <wangfuzheng0814@foxmail.com>
@JingsongLi

Copy link
Copy Markdown
Contributor

+1

@JingsongLi
JingsongLi merged commit dd1b91d into apache:master Aug 13, 2026
12 of 14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants